Repository navigation
[ci] Exclude previous-major packs from APIScan - #13876
Open
simonrozsival wants to merge 4 commits into
Open
simonrozsival wants to merge 4 commits into
simonrozsival wants to merge 4 commits into
Conversation
The nightly scan collects the previous workload installed for multi-targeting as well as the packs produced by this build. This adds seven unrelated findings from removed binutils and libZipSharpNative, and overwrites duplicate scan inputs. Evaluate AndroidNetPreviousVersion from eng/Versions.props with the provisioned SDK and exclude that version from collection, without duplicating its package pin in YAML. Validation: dotnet msbuild eng/Versions.props -nologo -getProperty:AndroidNetPreviousVersion returned 37.2.0-rc.2.84; PowerShell version lookup passed; pipeline YAML parsed; minimatch replay of all 388 recorded copy operations excluded 215 previous-major files and retained all 173 current files; git diff --check passed. A live Windows APIScan run was not performed. The three remaining Guardian findings are marked notSuppressible and require a supported APIScan remediation rather than signature suppressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
After the previous-major packs are excluded, APIScan still reports
three findings that cannot be fixed in this repo:
* aapt2.exe `missingsymbols` and `documentationnotfound`: aapt2 is a
Google prebuilt, so Microsoft symbols are unavailable and its CRT
imports come from Google's toolchain.
* Microsoft.Android.Runtime.NativeAOT.dll `documentationnotfound`:
`log!__android_log_print` is the Android NDK liblog API, not a
Windows API.
Add signature-scoped suppressions (taken from the APIScan Logs
artifact of build 16187926; identical in 16175170) to
.gdn/apiscan/apiscan.gdnsuppress, and pass it to `PostAnalysis@2`.
Note: APIScan marks these SARIF results `notSuppressible: true`.
Guardian may ignore the suppressions; if it does, these need an
APIScan exception or must be removed from the scan inputs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This reverts commit e65f9fd. APIScan marks all three remaining results `notSuppressible: true`. Guardian therefore most likely ignores signature suppressions for them, and the file would read as an approved exception that was never granted. No dotnet repo has a working APIScan suppression precedent; macios's PostAnalysis step is disabled with `condition: false`. The aapt2.exe and NativeAOT liblog findings need a supported APIScan remediation: an APIScan/1ES exception, or excluding the third-party binary from scan inputs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active in-scope review issues remain; the three APIScan findings are outside this change’s scope, and live Windows nightly validation remains pending.
No open issues 🎉
What changed in this PR
Updates nightly APIScan collection to exclude previous-major .NET for Android packs installed for multi-targeting, keeping scan inputs focused on the current build.
Changes:
- Reads the previous-major pack version from
eng/Versions.propsusing the provisioned SDK. - Excludes matching packs without duplicating the version pin in YAML.
The three remaining APIScan findings are outside this change’s scope; live Windows nightly validation remains pending.
| File | Description |
|---|---|
build-tools/automation/azure-pipelines-nightly.yaml |
Resolves the previous-major version and excludes its packs from APIScan collection. |
Review effort: Balanced
Member
|
/azp run Xamarin.Android-PR |
|
No pipelines are associated with this pull request. |
`dotnet msbuild -getProperty` prints an empty line and exits 0 when a
property is undefined. If `AndroidNetPreviousVersion` were ever renamed
or removed from eng/Versions.props, the exclusion would become
`Microsoft.Android*\\**`. That excludes every pack, so APIScan would
scan nothing and pass.
Trim the output and fail the step unless it is a single version string.
Validation: replayed all 388 paths from nightly 16187926's collect log
through azure-pipelines-task-lib `tl.match` (as used by CopyFiles@2)
with win32 semantics:
* version 37.2.0-rc.2.84: excludes exactly the 215 files under
Microsoft.Android.Sdk.Windows\37.2.0-rc.2.84 and keeps all 173 others.
* empty version: excludes all 388 (the case this guard prevents).
* unexpanded variable: excludes nothing.
The pwsh step returns 37.2.0-rc.2.84 locally and fails for an undefined
property or multi-line output.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Reviewed the APIScan previous-major exclusion. What I checked:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
324e9565eb346987cc6a86b0de94735ca7f1855b-getPropertyreturns37.2.0-rc.2.84locally.↑ Replaying the recorded collect log through task-lib
tl.match(win32) excludes all 215 previous-major files and keeps all 173 current ones, plus near-miss paths.↑ The step now fails on an empty or malformed version, which would otherwise exclude every pack.
↑ Two code reviews found no issues in the net change.
↓ No live Windows nightly APIScan run yet.
↑ Identical signatures in nightly builds 16175170 and 16187926.
↓ The 3 aapt2/NativeAOT findings remain, so the step will still fail until an exception is granted.
Context: 13e05fe
The
mainnightly "Fail Build on Guardian Issues" step in the API Scan job fails every night with 10 active APIScan results. The Collect Files for APIScan step copies everyMicrosoft.Android*pack underbin\$(XA.Build.Configuration)\dotnet\packs. That includes the previous-major workload (currently 37.2.0-rc.2.84), which is installed only for multi-targeting and is not produced by this build. Seven findings come only from that pack:missingsymbolsfor the binutils/LLVM toolsas.exe,ld.exe,llc.exe,llvm-mc.exe,llvm-objcopy.exe,llvm-strip.exe. These appeared after 13e05fe removed binutils from the current pack and stopped downloading their PDBs.missingsymbolsforlibzipsharpnative-3-3.dll.Because the copy is flattened with overwrite,
aapt2.exefrom the two packs also races, and the last copy wins.Read
$(AndroidNetPreviousVersion)fromeng/Versions.propswith the provisioned localdotnet msbuild -getProperty, and excludeMicrosoft.Android*\$(AndroidNetPreviousVersion)\**from collection. This avoids duplicating the version pin in YAML.-getPropertyprints an empty line and exits 0 for an undefined property, and an empty version would turn the exclusion intoMicrosoft.Android*\\**, which excludes everything. So the step fails unless the value is a single version string. The previous-major packs are scanned by their own release branch.Not addressed
The 3 remaining findings still fail the step:
aapt2.exemissingsymbolsanddocumentationnotfound: a Google prebuilt.Microsoft.Android.Runtime.NativeAOT.dlldocumentationnotfoundforlog!__android_log_print: the Android NDK liblog API.APIScan marks all of them
notSuppressible: true, so Guardian signature suppressions are not a supported fix. An earlier suppression-file attempt was reverted on this branch. They need an APIScan/1ES exception decision, or, foraapt2.exe, removal from the scan inputs.Validation
dotnet msbuild eng/Versions.props -nologo -getProperty:AndroidNetPreviousVersion→37.2.0-rc.2.84git diff --checkis clean.azure-pipelines-task-libtl.matchwith win32 semantics (as CopyFiles@2 calls it):37.2.0-rc.2.84: the 215Microsoft.Android.Sdk.Windows\37.2.0-rc.2.84files are excluded. All 173 current files are retained, as are…\37.2.0-rc.2.840\…, a current-pack subdirectory named37.2.0-rc.2.84, and dot-directories.37.2.0-rc.2.84locally and exits 1 for an undefined property or multi-line output.mainnightly should show 3 active results and no37.2.0-rcpaths in the collect log.